﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ShoppingCart.ascx.vb" Inherits="FrontEnd_Control_ShoppingCart" %>
<%@ Import Namespace="Cls_Common" %>

<asp:UpdatePanel ID="uplShoppingCart" runat="server">
    <ContentTemplate>


<div class="categories_title_right">
      <h1>GIỎ HÀNG CỦA BẠN</h1>
    </div>
<script type="text/javascript">

    function ThanhToan() {
        $("#viewCart").toggle("slow");
        $("#thanhtoan").toggle("slow");

        return false;
    }
    function updateCart() {
        var sum = $("#<% =lblTongTien.ClientID()%>").text() ;
        if (sum == "") {
            sum=0;
         };
        var txt =  $("#<% =hidProductCount.ClientID() %>").val() + " sản phẩm :</span> <span>(" + sum + " đ)</span>";
        $("#GiohangTop").html(txt);
        
        return false;
    }
    function ajaxJquery() {
        $(function () {
            $("#thanhtoan").toggle("fast");

            $("#<% =btnGioHangBack.ClientID() %>").click(function () {

                $("#viewCart").toggle("slow");
                $("#thanhtoan").toggle("slow");
                return false;

            });

        });

    }               
    </script>
 

 <div class="bgmid_porletright">
<div id="viewCart" style="min-height:350px; padding-left:10px">
    <asp:DataGrid id="ShpCartList" runat="server" Width="98%" HorizontalAlign="Center" AutoGenerateColumns="False"
        DataKeyField="Quantity" ShowFooter="True"
        Font-Size="13px"  CellSpacing="5" cellpadding="5" GridLines="Vertical" BorderColor="#FF00FF"
        Font-Names="Arial" CssClass="tablelist" >
        
        <AlternatingItemStyle CssClass="tbl_row_alternating"></AlternatingItemStyle>
        <ItemStyle CssClass="row1"></ItemStyle>
        <HeaderStyle CssClass="row_title"></HeaderStyle>
        <FooterStyle CssClass="row1"></FooterStyle>
        
        <Columns>
            <asp:TemplateColumn>
                <ItemTemplate>
                    <span>
	                    <%# Container.ItemIndex+1 %>
                    </span>
                </ItemTemplate>
            </asp:TemplateColumn>	        
	        
            <asp:TemplateColumn HeaderText="Mã Sản phẩm">
                <ItemTemplate>
                    <asp:Label id="lblProductCode" runat="server" Text=''/>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateColumn>

            <asp:TemplateColumn HeaderText="Tên Sản phẩm">
            <ItemTemplate>
                <asp:HyperLink id="hplTitle" runat="server" CssClass="links" />
            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                <HeaderStyle HorizontalAlign="Center" />
        </asp:TemplateColumn>

            <asp:TemplateColumn HeaderText="Cửa hàng" Visible="false">
            <ItemTemplate>
                <asp:HyperLink id="hplStore" runat="server" />
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Center" />
         </asp:TemplateColumn>

            
            <asp:TemplateColumn HeaderText="Đơn giá">
                <ItemTemplate>
                   <asp:Label ID="lblPrice" runat="server">Giá</asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" />
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateColumn>					        						        
	        

	        						                                        
            <asp:TemplateColumn HeaderText="Số lượng">
                <ItemTemplate>
                    <asp:TextBox CssClass="TextBox" id="txtQuantity" runat="server" Columns="4" MaxLength="4" Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' width="50px" style="text-align:right;" meta:resourcekey="txtQuantityResource1" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" />
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateColumn>	

            <asp:TemplateColumn HeaderText="Thành tiền">
                <ItemTemplate>
                   <asp:Label ID="lblSumPrice" runat="server">sum</asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" />
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateColumn>		        
	        
            <asp:TemplateColumn HeaderText="Xóa">
                <ItemTemplate>
                    <center>
	                    <asp:CheckBox id="Remove" runat="server" meta:resourcekey="RemoveResource1" />
                    </center>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
            </asp:TemplateColumn>
        </Columns>
    </asp:DataGrid>
<div style="text-align:right;font-family:Arial;font-size:13px; height:40px; padding-top:5px;">
    Tổng tiền:<asp:Label id="lblTongTien" runat="server" CssClass="price"></asp:Label> đ &nbsp;
</div>
<div style="text-align:center">      

    <asp:button id="btnUpdate" CssClass="button buy"  runat="server" Text="Cập nhật" CausesValidation="False"/>
    <div class="space10"> &nbsp; </div>
    <asp:button id="btnCheckOut" CssClass="button buy"  runat="server" Text="Thanh toán" CausesValidation="False"/>

</div>  

</div>

<div id="thanhtoan" style="text-align:justify !important;padding-left:10px">
   
        <div>
                <div class="Note">Vui lòng cung cấp đầy đủ thông tin để chúng tôi phục vụ tốt nhất cho bạn</div>
                <div class="lblEdit">
                    <asp:Label ID="lblCustomerName_edit" runat="server" Text="Tên quí khách:" />
                </div>
                <div>
                    <asp:TextBox ID="txtCustomerName" CssClass="TextBox" runat="server" Text="" Width="350px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCustomerName"
                        ErrorMessage="Hãy nhập tên của bạn" SetFocusOnError="True">*</asp:RequiredFieldValidator></div>
                <div class="lblEdit">
                    <asp:Label ID="lblCustomerAddress_edit" runat="server" Text="Địa chỉ:" />
                </div>
                <div>
                    <asp:TextBox ID="txtCustomerAddress" CssClass="TextBox" runat="server" Text="" Width="350px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCustomerAddress"
                        ErrorMessage="Hãy nhập địa chỉ của bạn" SetFocusOnError="True">*</asp:RequiredFieldValidator></div>
                <div class="lblEdit">
                    <asp:Label ID="lblCustomerEmail_edit" runat="server" Text="Email:" />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCustomerEmail"
                        ErrorMessage="Định dạng email chưa đúng" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></div>
                <div>
                    <asp:TextBox ID="txtCustomerEmail" CssClass="TextBox" runat="server" Text="" Width="350px" />
                </div>
                <div class="lblEdit">
                    <asp:Label ID="lblCustomerPhone_edit" runat="server" Text="Số điện thoại:" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Hãy nhập số điện thoại"
                        SetFocusOnError="True" ControlToValidate="txtCustomerPhone">*</asp:RequiredFieldValidator></div>
                <div>
                    <asp:TextBox ID="txtCustomerPhone" CssClass="TextBox" runat="server" Text="" Width="350px" />
                    </div>
                <div class="lblEdit">
                    <asp:Label ID="lblCustomerNote_edit" runat="server" Text="Ghi chú" />
                </div>
                <div>
                    <asp:TextBox ID="txtCustomerNote" CssClass="TextBox" runat="server" Text="" TextMode="MultiLine" Height="102px" Width="350px" />
                </div>
                <div style="padding-top:5px;">
                  <asp:Button ID="btnSave" runat="server" Text="Hoàn tất" CssClass="button buy" />
                  <div class="space10"> &nbsp; </div>
                  <asp:Button ID="btnGioHangBack" runat="server" Text="Quay lại" CssClass="button buy" CausesValidation="false" />  

                    &nbsp;
                </div>

        </div>                
</div>
             




</div>

 <div class="bgbottom_porletright"></div>
<asp:HiddenField ID="hidProductCount" runat="server" />
 </ContentTemplate>
 </asp:UpdatePanel>
            



<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
  ShowSummary="False" />







        		
